#ifndef _ENCRYPTION_H_
#define _ENCRYPTION_H_

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stddef.h>

/* typedef -------------------------------------------------------------------*/
struct MD5
{
    uint32_t count[2];
    uint32_t state[4];
    uint8_t buffer[64];   
};

/* define --------------------------------------------------------------------*/
/* macro ---------------------------------------------------------------------*/
/* variables -----------------------------------------------------------------*/
/* function prototypes -------------------------------------------------------*/
uint32_t Crc32(void *start, size_t length, uint32_t crcLast);
uint16_t Crc16(void *data, size_t length);
uint8_t Crc8(uint8_t *p, size_t length);

void MD5_Init(struct MD5 *context);
void MD5_Update(struct MD5 *context, uint8_t *input, size_t inputlen);
void MD5_Final(struct MD5 *context, uint8_t digest[16]);
void MD5_Transform(uint32_t state[4], uint8_t block[64]);
void MD5_Encode(uint8_t *output, uint32_t *input, size_t len);
void MD5_Decode(uint32_t *output, uint8_t *input, size_t len);

/* functions -----------------------------------------------------------------*/
#endif
